
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>service/router · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="service.html" />
    
    
    <link rel="prev" href="validator.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    概览
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    快速入门
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../guides/project.html">
            
                <a href="../guides/project.html">
            
                    
                    项目结构和初始化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../guides/api.html">
            
                <a href="../guides/api.html">
            
                    
                    API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../guides/doc.html">
            
                <a href="../guides/doc.html">
            
                    
                    生成 API 文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../guides/client.html">
            
                <a href="../guides/client.html">
            
                    
                    生成客户端
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    概念
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../concepts/cp.html">
            
                <a href="../concepts/cp.html">
            
                    
                    Consumer && Producer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../concepts/operator.html">
            
                <a href="../concepts/operator.html">
            
                    
                    Operator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../concepts/filter.html">
            
                <a href="../concepts/filter.html">
            
                    
                    Filter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../concepts/prefab.html">
            
                <a href="../concepts/prefab.html">
            
                    
                    Prefab
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../concepts/modifier.html">
            
                <a href="../concepts/modifier.html">
            
                    
                    Modifier
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../concepts/middleware.html">
            
                <a href="../concepts/middleware.html">
            
                    
                    Middleware
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../concepts/context.html">
            
                <a href="../concepts/context.html">
            
                    
                    Context
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../concepts/source.html">
            
                <a href="../concepts/source.html">
            
                    
                    Parameter Generator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../concepts/destination.html">
            
                <a href="../concepts/destination.html">
            
                    
                    Destination Handler
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../concepts/error.html">
            
                <a href="../concepts/error.html">
            
                    
                    错误包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../concepts/method.html">
            
                <a href="../concepts/method.html">
            
                    
                    方法包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../concepts/configurer.html">
            
                <a href="../concepts/configurer.html">
            
                    
                    配置器机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../concepts/plugin.html">
            
                <a href="../concepts/plugin.html">
            
                    
                    插件机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="../concepts/clients.html">
            
                <a href="../concepts/clients.html">
            
                    
                    多客户端整合
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    插件
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../plugins/logger.html">
            
                <a href="../plugins/logger.html">
            
                    
                    系统日志插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../plugins/reqlog.html">
            
                <a href="../plugins/reqlog.html">
            
                    
                    请求日志插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../plugins/metrics.html">
            
                <a href="../plugins/metrics.html">
            
                    
                    监控指标插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../plugins/tracing.html">
            
                <a href="../plugins/tracing.html">
            
                    
                    请求追踪插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../plugins/profiling.html">
            
                <a href="../plugins/profiling.html">
            
                    
                    性能分析插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../plugins/version.html">
            
                <a href="../plugins/version.html">
            
                    
                    版本信息插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.7" data-path="../plugins/healthcheck.html">
            
                <a href="../plugins/healthcheck.html">
            
                    
                    健康检查插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    框架开发者指南
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="start.html">
            
                <a href="start.html">
            
                    
                    准备工作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="log.html">
            
                <a href="log.html">
            
                    
                    log
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="errors.html">
            
                <a href="errors.html">
            
                    
                    errors
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="definition.html">
            
                <a href="definition.html">
            
                    
                    definition
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="method.html">
            
                <a href="method.html">
            
                    
                    definition/method
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="converter.html">
            
                <a href="converter.html">
            
                    
                    operators/converter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="validator.html">
            
                <a href="validator.html">
            
                    
                    operators/validator
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.8" data-path="router.html">
            
                <a href="router.html">
            
                    
                    service/router
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="service.html">
            
                <a href="service.html">
            
                    
                    service
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="nirvana.html">
            
                <a href="nirvana.html">
            
                    
                    nirvana
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.11" data-path="config.html">
            
                <a href="config.html">
            
                    
                    config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.12" data-path="rest.html">
            
                <a href="rest.html">
            
                    
                    rest
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.13" data-path="utils.html">
            
                <a href="utils.html">
            
                    
                    utils
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.14" data-path="command.html">
            
                <a href="command.html">
            
                    
                    cmd/nirvana
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >service/router</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="router-&#x5305;">router &#x5305;</h1>
<p>router &#x5305;&#x5B9E;&#x73B0;&#x4E86;&#x57FA;&#x4E8E;&#x524D;&#x7F00;&#x6811;&#x7684;&#x8DEF;&#x7531;&#xFF0C;&#x5E76;&#x63D0;&#x4F9B;&#x4E86;&#x4E09;&#x79CD;&#x7C7B;&#x578B;&#x7684;&#x8DEF;&#x7531;&#x8282;&#x70B9;&#xFF1A;</p>
<ol>
<li>&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x8282;&#x70B9;</li>
<li>&#x6B63;&#x5219;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#xFF08;&#x5305;&#x62EC;&#x4E00;&#x4E2A;&#x5168;&#x5339;&#x914D;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#xFF09;</li>
<li>&#x5269;&#x4F59;&#x8DEF;&#x5F84;&#x7C7B;&#x578B;&#x8282;&#x70B9;</li>
</ol>
<p>&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-comment">// stringNode describes a string router node.</span>
<span class="hljs-keyword">type</span> stringNode <span class="hljs-keyword">struct</span> {
    handler
    children
    <span class="hljs-comment">// prefix is the fixed string to match path.</span>
    prefix <span class="hljs-keyword">string</span>
}
</code></pre>
<p>&#x5B57;&#x7B26;&#x4E32;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#x8FDB;&#x884C;&#x5B57;&#x7B26;&#x4E32;&#x5339;&#x914D;&#x3002;&#x5728;&#x5339;&#x914D;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x8DEF;&#x5F84;&#x524D;&#x7F00;&#x5FC5;&#x987B;&#x4E0E; prefix &#x5B8C;&#x5168;&#x5339;&#x914D;&#x3002;</p>
<p>&#x6B63;&#x5219;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-comment">// index contains the key and it&apos;s index of the submatches.</span>
<span class="hljs-keyword">type</span> index <span class="hljs-keyword">struct</span> {
    <span class="hljs-comment">// Key is the name for the value.</span>
    Key <span class="hljs-keyword">string</span>
    <span class="hljs-comment">// Pos is the index of value in submatches.</span>
    Pos <span class="hljs-keyword">int</span>
}

<span class="hljs-comment">// regexpNode contains information for matching a regexp segment.</span>
<span class="hljs-keyword">type</span> regexpNode <span class="hljs-keyword">struct</span> {
    handler
    children
    <span class="hljs-comment">// indices contains all positions to get values from submatches.</span>
    indices []index
    <span class="hljs-comment">// exp is the regular expression.</span>
    exp <span class="hljs-keyword">string</span>
    <span class="hljs-comment">// regexp is a regexp instance to match.</span>
    regexp *regexp.Regexp
}
</code></pre>
<p>&#x6B63;&#x5219;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#x5219;&#x6839;&#x636E;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5339;&#x914D;&#x4E00;&#x6BB5;&#x8DEF;&#x5F84;&#xFF0C;&#x5E76;&#x63D0;&#x53D6;&#x51FA;&#x5339;&#x914D;&#x7684;&#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<p>&#x5168;&#x5339;&#x914D;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#x662F;&#x6B63;&#x5219;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#x7684;&#x4E00;&#x4E2A;&#x7279;&#x4F8B;&#xFF0C;&#x5373;&#x7B49;&#x4EF7;&#x4E8E;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x7684; <code>.*</code>&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-comment">// fullMatchRegexpNode is an optimizing of RegexpNode.</span>
<span class="hljs-keyword">type</span> fullMatchRegexpNode <span class="hljs-keyword">struct</span> {
    handler
    children
    <span class="hljs-comment">// key is the name for the only value.</span>
    key <span class="hljs-keyword">string</span>
}
</code></pre>
<p>&#x8FD9;&#x662F;&#x5BF9;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x7684;&#x4E00;&#x4E2A;&#x5E38;&#x7528;&#x7279;&#x4F8B;&#x7684;&#x4F18;&#x5316;&#xFF0C;&#x5FEB;&#x901F;&#x8FDB;&#x884C;&#x5168;&#x5339;&#x914D;&#x3002;</p>
<p>&#x6B63;&#x5219;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#x548C;&#x5168;&#x5339;&#x914D;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#x5B58;&#x5728;&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x7684;&#x9650;&#x5236;&#xFF1A;&#x53EA;&#x80FD;&#x5339;&#x914D;&#x5230;&#x4E0B;&#x4E00;&#x4E2A; / &#x4E4B;&#x524D;&#x3002;</p>
<p>&#x5269;&#x4F59;&#x8DEF;&#x5F84;&#x7C7B;&#x578B;&#x8282;&#x70B9;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-comment">// pathNode matches all rest path.</span>
<span class="hljs-keyword">type</span> pathNode <span class="hljs-keyword">struct</span> {
    handler
    <span class="hljs-comment">// key is the key for the rest path.</span>
    key <span class="hljs-keyword">string</span>
}
</code></pre>
<p>&#x8FD9;&#x4E2A;&#x8282;&#x70B9;&#x5339;&#x914D;&#x5269;&#x4F59;&#x6240;&#x6709;&#x8DEF;&#x5F84;&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x7528;&#x4E00;&#x4E2A;&#x4F8B;&#x5B50;&#x6765;&#x8BF4;&#x660E;&#x8FD9;&#x51E0;&#x4E2A;&#x8282;&#x70B9;&#xFF1A;</p>
<pre><code class="lang-go">API Path: /apis/v1/{regexp:[a-z]{<span class="hljs-number">1</span>,<span class="hljs-number">2</span>}}/{fullmatch}/{path:*}
Matched Path: /apis/v1/ab/something/the/rest/path
Generated Nodes:
  String Node: /apis/v1/           -&gt;    /apis/v1/
  Regexp Node: regexp:[a-z]{<span class="hljs-number">1</span>,<span class="hljs-number">2</span>}   -&gt;    ab
  String Node: /                   -&gt;    /
  Full Match Node: fullmatch:.*    -&gt;    something
  String Node: /                   -&gt;    /
  Path Node: *                     -&gt;    the/rest/path
</code></pre>
<p>&#x4E00;&#x4E2A;&#x8DEF;&#x5F84;&#x5728;&#x524D;&#x7F00;&#x6811;&#x7684;&#x8282;&#x70B9;&#x4E2D;&#x4ECE;&#x6839;&#x8282;&#x70B9;&#x5F00;&#x59CB;&#x8FDB;&#x884C;&#x5339;&#x914D;&#xFF0C;&#x76F4;&#x5230;&#x67D0;&#x4E2A;&#x540E;&#x4EE3;&#x8282;&#x70B9;&#x5339;&#x914D;&#x5B8C;&#x4E86;&#x6574;&#x4E2A;&#x8DEF;&#x5F84;&#xFF0C;&#x90A3;&#x4E48;&#x8FD9;&#x4E2A;&#x540E;&#x4EE3;&#x8282;&#x70B9;&#x5C31;&#x4F1A;&#x4F5C;&#x4E3A;&#x8FD9;&#x4E2A;&#x8DEF;&#x5F84;&#x7684;&#x5339;&#x914D;&#x94FE;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x8282;&#x70B9;&#xFF0C;&#x5373;&#x4F7F;&#x8FD9;&#x4E2A;&#x8282;&#x70B9;&#x8FD8;&#x6709;&#x540E;&#x4EE3;&#x8282;&#x70B9;&#xFF0C;&#x4E5F;&#x4E0D;&#x4F1A;&#x7EE7;&#x7EED;&#x8FDB;&#x884C;&#x5339;&#x914D;&#x3002;&#x56E0;&#x6B64;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x90FD;&#x53EF;&#x80FD;&#x662F;&#x67D0;&#x4E9B;&#x8DEF;&#x5F84;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x8282;&#x70B9;&#x3002;</p>
<p>&#x5728;&#x4E0A;&#x9762;&#x7684;&#x8DEF;&#x5F84;&#x8282;&#x70B9;&#x4E2D;&#xFF0C;&#x6BCF;&#x4E2A;&#x8282;&#x70B9;&#x90FD;&#x53EF;&#x4EE5;&#x7ED1;&#x5B9A;&#x4E00;&#x4E2A; Inspector&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-comment">// Inspector can select an executor to execute.</span>
<span class="hljs-keyword">type</span> Inspector <span class="hljs-keyword">interface</span> {
    <span class="hljs-comment">// Inspect finds a valid executor to execute target context.</span>
    <span class="hljs-comment">// It returns an error if it can&apos;t find a valid executor.</span>
    Inspect(context.Context) (Executor, error)
}

<span class="hljs-comment">// Executor executs with a context.</span>
<span class="hljs-keyword">type</span> Executor <span class="hljs-keyword">interface</span> {
    <span class="hljs-comment">// Execute executes with context.</span>
    Execute(context.Context) error
}
</code></pre>
<p>&#x8DEF;&#x5F84;&#x5339;&#x914D;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x4F1A;&#x8C03;&#x7528;&#x5339;&#x914D;&#x94FE;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x8282;&#x70B9;&#x7684; Inspector &#x6765;&#x751F;&#x6210;&#x4E00;&#x4E2A;&#x80FD;&#x591F;&#x5904;&#x7406;&#x5F53;&#x524D;&#x7684;&#x8DEF;&#x7531;&#x4E0A;&#x4E0B;&#x6587;&#x7684; Executor&#x3002;Inspector &#x5982;&#x679C;&#x80FD;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A; Executor&#xFF0C;router &#x4F1A;&#x5C06;&#x6574;&#x4E2A;&#x5339;&#x914D;&#x94FE;&#x4E0A;&#x6240;&#x6709;&#x8282;&#x70B9;&#x6309;&#x7167;&#x4ECE;&#x6839;&#x8282;&#x70B9;&#x5F00;&#x59CB;&#x7684;&#x987A;&#x5E8F;&#x5C06;&#x4E2D;&#x95F4;&#x4EF6;&#x4E32;&#x8054;&#x8D77;&#x6765;&#xFF0C;&#x5E76;&#x7ED1;&#x5B9A;&#x4E0A;&#x8FD9;&#x4E2A; Executor&#x3002;&#x5982;&#x679C;&#x4E0D;&#x80FD;&#x8FD4;&#x56DE; Executor&#xFF0C;&#x5219;&#x8BA4;&#x4E3A;&#x8DEF;&#x7531;&#x5339;&#x914D;&#x5931;&#x8D25;&#x3002;&#x5339;&#x914D;&#x5931;&#x8D25;&#x7684;&#x8BDD;&#xFF0C;&#x4E2D;&#x95F4;&#x4EF6;&#x90FD;&#x4E0D;&#x4F1A;&#x6267;&#x884C;&#x3002;</p>
<p>&#x4E2D;&#x95F4;&#x4EF6;&#x63A5;&#x53E3;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-go"><span class="hljs-comment">// RoutingChain contains the call chain of middlewares and executor.</span>
<span class="hljs-keyword">type</span> RoutingChain <span class="hljs-keyword">interface</span> {
    <span class="hljs-comment">// Continue continues to execute the next middleware or executor.</span>
    Continue(context.Context) error
}

<span class="hljs-comment">// Middleware describes the form of middlewares. If you want to</span>
<span class="hljs-comment">// carry on, call RoutingChain.Continue() and pass the context.</span>
<span class="hljs-keyword">type</span> Middleware <span class="hljs-keyword">func</span>(context.Context, RoutingChain) error
</code></pre>
<p>&#x5BF9;&#x4E8E;&#x4E2D;&#x95F4;&#x4EF6;&#x800C;&#x8A00;&#xFF0C;&#x5904;&#x7406;&#x5B8C;&#x5F53;&#x524D;&#x7684;&#x4EFB;&#x52A1;&#x4E4B;&#x540E;&#x53EA;&#x9700;&#x8981;&#x8C03;&#x7528; RoutingChain &#x5C06; Context &#x901A;&#x8FC7; Continue &#x4F20;&#x9012;&#x4E0B;&#x53BB;&#x5373;&#x53EF;&#x3002;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x963B;&#x585E;&#x8FC7;&#x7A0B;&#xFF0C;&#x53EA;&#x6709;&#x540E;&#x7EED;&#x7684;&#x4E2D;&#x95F4;&#x4EF6;&#x6267;&#x884C;&#x5B8C;&#x6210;&#x4E86;&#x624D;&#x4F1A;&#x8FD4;&#x56DE;&#x3002;&#x800C;&#x6700;&#x540E;&#x4E00;&#x4E2A;&#x4E2D;&#x95F4;&#x4EF6;&#x8C03;&#x7528; Continue &#x5B9E;&#x9645;&#x4E0A;&#x662F;&#x8C03;&#x7528;&#x7684; Executor&#xFF0C;&#x56E0;&#x6B64;&#x6240;&#x6709;&#x4E2D;&#x95F4;&#x4EF6;&#x7684; Continue &#x6267;&#x884C;&#x5B8C;&#x6210;&#x4E4B;&#x540E;&#xFF0C;&#x8BF7;&#x6C42;&#x4E5F;&#x5904;&#x7406;&#x5B8C;&#x6210;&#x4E86;&#x3002;</p>
<p><strong>&#x6CE8;&#xFF1A;&#x8FD9;&#x4E2A;&#x5305;&#x91CC;&#x6240;&#x6709;&#x7684;&#x63A5;&#x53E3;&#x90FD;&#x4E0D;&#x4F1A;&#x88AB;&#x7528;&#x6237;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#xFF0C;&#x7528;&#x6237;&#x53EA;&#x80FD;&#x901A;&#x8FC7; definition &#x5305;&#x8FDB;&#x884C; API &#x5B9A;&#x4E49;&#xFF0C;&#x7136;&#x540E;&#x7531; service &#x5305;&#x8FDB;&#x884C;&#x8DEF;&#x7531;&#x6784;&#x5EFA;&#x548C;&#x5339;&#x914D;&#x3002;</strong></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="validator.html" class="navigation navigation-prev " aria-label="Previous page: operators/validator">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="service.html" class="navigation navigation-next " aria-label="Next page: service">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"service/router","level":"1.5.8","depth":2,"next":{"title":"service","level":"1.5.9","depth":2,"path":"topics/service.md","ref":"topics/service.md","articles":[]},"previous":{"title":"operators/validator","level":"1.5.7","depth":2,"path":"topics/validator.md","ref":"topics/validator.md","articles":[]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"language":"zh-hans","gitbook":"*"},"file":{"path":"topics/router.md","mtime":"2019-08-06T09:48:58.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-10-20T10:33:16.586Z"},"basePath":"..","book":{"language":"zh-hans"}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

